package month3.day29;

public class Feixingyuan {
    private String name;

    public Feixingyuan(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void kaifeiji(Feiji f){
        if(f instanceof Keji){
            System.out.print("飞行员"+name+"开客机，");
            f.show();
            f.qifei();
            f.jiangluo();
        }else if(f instanceof Zhandoji){
            System.out.print("飞行员"+name+"开战斗机，");
            f.show();
            Zhandoji zdj=(Zhandoji) f;
            f.qifei();
            zdj.daodan();
            zdj.panxuan();
            f.jiangluo();
        }
    }


}
